home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CUGUK / GAMES / C014.ZIP / LARN_SRC.ZIP / PATCHES0 < prev    next >
Text File  |  1993-11-17  |  11KB  |  353 lines

  1.  
  2. *** patchlog.org Mon May 13 21:26:38 1991
  3. --- patchlog    Mon May 13 21:24:36 1991
  4. ***************
  5. *** 0 ****
  6. --- 1,16 ----
  7. + Patch 1
  8. + =======
  9. +
  10. + Prompted by Pat Ryan, fix a bug in the dropobj() code in main.c that
  11. + allowed the player to drop a negative amount of gold.  In the process, fix
  12. + the backwards carriage return logic when printing the error response.
  13. +
  14. + Document the new SIG_RETURNS_INT #define introduced by Bill Randle when the
  15. + software was posted.
  16. +
  17. + Prompted by Lasse Oestergaard, guard against out-of-bound array references
  18. + in movem.c when on the Home level.  Also fixed a bug where a 'smart' monster
  19. + would fail to move towards the player when the player was on the boundary.
  20. +
  21. + Prompted by Mitch Gorman, make the EXTRA #define compile and work under
  22. + MS-DOS.
  23. *** patchlev.org    Sat Mar 23 14:08:52 1991
  24. --- patchlev.h  Mon May 13 21:17:10 1991
  25. ***************
  26. *** 1,3 ****
  27.   /* indicate which patches have been applied to Larn.
  28.   */
  29. ! #define PATCHLEVEL 0
  30. --- 1,3 ----
  31.   /* indicate which patches have been applied to Larn.
  32.   */
  33. ! #define PATCHLEVEL 1
  34. *** config.org  Sat Jul 07 13:58:52 1990
  35. --- config.c    Mon May 13 20:32:26 1991
  36. ***************
  37. *** 73,78 ****
  38. --- 73,81 ----
  39.   char ckpfile[PATHLEN];
  40.   char swapfile[PATHLEN];
  41.   char larndir[DIRLEN]        = LARNHOME;
  42. + # ifdef EXTRA
  43. + char diagfile[PATHLEN];        /* the diagnostic filename  */
  44. + # endif
  45.   #   else
  46.   char savefilename[PATHLEN]  = LARNHOME;
  47.   char scorefile[PATHLEN]     = LARNHOME;
  48. *** diag.org    Sat Jul 07 13:47:32 1990
  49. --- diag.c  Mon May 13 20:32:16 1991
  50. ***************
  51. *** 24,29 ****
  52. --- 24,31 ----
  53.   extern int rmst,maxitm,lasttime;
  54.   extern char nosignal;
  55.   
  56. + #define max( _a, _b ) (( _a > _b ) ? _a : _b )
  57.   /*
  58.       ***************************
  59.       DIAG -- dungeon diagnostics
  60. ***************
  61. *** 124,129 ****
  62. --- 126,133 ----
  63.       lcreat((char*)0);       lprcat("Done Diagnosing . . .");
  64.       return(0);
  65.       }
  66. + #ifndef MSDOS
  67.   /*
  68.       subroutine to count the number of occurrences of an object
  69.    */
  70. ***************
  71. *** 139,144 ****
  72. --- 143,149 ----
  73.                   if (cell[(long) p*MAXX*MAXY+i*MAXY+j].item == l) k++;
  74.       return(k);
  75.       }
  76. + #endif
  77.   
  78.   /*
  79.       subroutine to draw the whole screen as the player knows it
  80. *** header.org  Mon Dec 24 14:10:10 1990
  81. --- header.h    Mon May 13 20:31:28 1991
  82. ***************
  83. *** 22,27 ****
  84. --- 22,28 ----
  85.   #define FORTSNAME   "larn.ftn"
  86.   #define PLAYERIDS   "larn.pid"
  87.   #define HOLIFILE    "holidays"
  88. + #define DIAGFILE    "Diagfile"
  89.   #ifdef MSDOS
  90.   #   define LARNOPTS "larn.opt"
  91.   #   define SAVEFILE "larn.sav"
  92. *** io.org  Tue Mar 26 14:39:08 1991
  93. --- io.c    Mon May 13 20:32:20 1991
  94. ***************
  95. *** 57,62 ****
  96. --- 57,66 ----
  97.   #include "larndefs.h"
  98.   #include <ctype.h>
  99.  
  100. + #ifdef EXTRA
  101. + # include "player.h"
  102. + #endif
  103. +
  104.   #ifdef SYSV /* system III or system V */
  105.   # ifndef MSDOS
  106.   #   include <termio.h>
  107. *** main.org    Tue Mar 26 15:00:36 1991
  108. --- main.c  Mon May 13 20:32:22 1991
  109. ***************
  110. *** 167,178 ****
  111.  
  112.       /* Savefile and swapfile can be given explicitly as options
  113.        */
  114. !     if (!savefilename[0]) 
  115.           {
  116.           strcpy(savefilename, larndir);
  117.           strcat(savefilename, SAVEFILE);
  118.           }
  119. !     if (!swapfile[0]) 
  120.           {
  121.           strcpy(swapfile, larndir);
  122.           strcat(swapfile, SWAPFILE);
  123. --- 167,178 ----
  124.   
  125.       /* Savefile and swapfile can be given explicitly as options
  126.        */
  127. !     if (!savefilename[0])
  128.           {
  129.           strcpy(savefilename, larndir);
  130.           strcat(savefilename, SAVEFILE);
  131.           }
  132. !     if (!swapfile[0])
  133.           {
  134.           strcpy(swapfile, larndir);
  135.           strcat(swapfile, SWAPFILE);
  136. ***************
  137. *** 184,193 ****
  138.       strcpy(fortfile, larndir);
  139.       strcpy(playerids, larndir);
  140.       strcpy(ckpfile, larndir);
  141.   
  142.   # else /* MSDOS */
  143.   
  144. !     if ((ptr = getenv("HOME")) == 0) 
  145.           ptr = ".";
  146.   #ifdef SAVEINHOME
  147.       /* save file name in home directory */
  148. --- 184,196 ----
  149.       strcpy(fortfile, larndir);
  150.       strcpy(playerids, larndir);
  151.       strcpy(ckpfile, larndir);
  152. + #  ifdef EXTRA
  153. +     strcpy(diagfile,larndir);
  154. + #  endif
  155.   
  156.   # else /* MSDOS */
  157.   
  158. !     if ((ptr = getenv("HOME")) == 0)
  159.           ptr = ".";
  160.   #ifdef SAVEINHOME
  161.       /* save file name in home directory */
  162. ***************
  163. *** 220,225 ****
  164. --- 223,232 ----
  165.       strcat(holifile, HOLIFILE);     /* the holiday data file name */
  166.   # endif
  167.   
  168. + # ifdef EXTRA
  169. +     strcat(diagfile, DIAGFILE);
  170. + # endif
  171.   #ifdef VT100
  172.   /*
  173.    *  check terminal type to avoid users who have not vt100 type terminals
  174. ***************
  175. *** 1036,1049 ****
  176.       {
  177.       register int i;
  178.       register char *p;
  179. !     long amt;
  180.   
  181.       p = &item[playerx][playery];
  182.       while (1)
  183.           {
  184. !         if ((i = whatitem("drop"))=='\33')  
  185.           return;
  186. !     if (i=='*') 
  187.           {
  188.           i = showstr(TRUE);
  189.           cursors();
  190. --- 1043,1056 ----
  191.       {
  192.       register int i;
  193.       register char *p;
  194. !     unsigned long amt;
  195.   
  196.       p = &item[playerx][playery];
  197.       while (1)
  198.           {
  199. !         if ((i = whatitem("drop"))=='\33')
  200.           return;
  201. !     if (i=='*')
  202.           {
  203.           i = showstr(TRUE);
  204.           cursors();
  205. ***************
  206. *** 1059,1065 ****
  207.                   if ((amt=readnum((long)c[GOLD])) == 0) return;
  208.                   if (amt>c[GOLD])
  209.                       {
  210. ! #ifndef MSDOS
  211.               lprcat("\n");
  212.   #endif MSDOS
  213.               lprcat("You don't have that much!");
  214. --- 1066,1072 ----
  215.                   if ((amt=readnum((long)c[GOLD])) == 0) return;
  216.                   if (amt>c[GOLD])
  217.                       {
  218. ! #ifdef MSDOS
  219.               lprcat("\n");
  220.   #endif MSDOS
  221.               lprcat("You don't have that much!");
  222. *** makefile.org    Sat Mar 23 19:09:40 1991
  223. --- makefile.pc   Mon May 13 21:15:22 1991
  224. ***************
  225. *** 31,36 ****
  226. --- 31,38 ----
  227.   #   RFCMAIL       - mail messages are RFC822 conformant.  Must be used with
  228.   #                   MAIL above.
  229.   #   SAVEINHOME    - put save files in users HOME instead of LARNHOME (default)
  230. + #   SIG_RETURNS_INT - define if signal() returns (int *)() instead of
  231. + #                   (void *)()
  232.   #   SYSV          - use system III/V (instead of V7) type ioctl calls
  233.   #   TIMECHECK     - incorporates code to disable play during working hours (8-5)
  234.   #   UIDSCORE      - Define to use user id's to manage scoreboard.  Leaving this
  235. *** movem.org   Sat Mar 23 16:14:34 1991
  236. --- movem.c Mon May 13 18:03:26 1991
  237. ***************
  238. *** 311,323 ****
  239.  
  240.         /* test all spots around the current one being looked at.
  241.         */
  242. !       if ( ( curx >= xl && curx < xh ) &&
  243. !            ( cury >= yl && cury < yh ) )
  244.             {
  245.             for (z=1; z<9; z++)
  246.             {
  247.             tmpx = curx + diroffx[z] ;
  248.             tmpy = cury + diroffy[z] ;
  249.             if (screen[tmpx][tmpy] == 0 )
  250.                 {
  251.                 screen[tmpx][tmpy] = curdist + 1;
  252. --- 311,324 ----
  253.   
  254.         /* test all spots around the current one being looked at.
  255.         */
  256. !       if ( ( curx >= xl && curx <= xh ) &&
  257. !            ( cury >= yl && cury <= yh ) )
  258.             {
  259.             for (z=1; z<9; z++)
  260.             {
  261.             tmpx = curx + diroffx[z] ;
  262.             tmpy = cury + diroffy[z] ;
  263. +           vxy( &tmpx, &tmpy );
  264.             if (screen[tmpx][tmpy] == 0 )
  265.                 {
  266.                 screen[tmpx][tmpy] = curdist + 1;
  267. ***************
  268. *** 448,453 ****
  269. --- 449,459 ----
  270.       xl=i-1;  yl=j-1;  xh=i+2;  yh=j+2;
  271.       if (i<playerx) xl++; else if (i>playerx) --xh;
  272.       if (j<playery) yl++; else if (j>playery) --yh;
  273. +     if (xl < 0) xl = 0;
  274. +     if (yl < 0) yl = 0;
  275. +     if (xh > MAXX) xh = MAXX; /* MAXX OK; loop check below is <, not <= */
  276. +     if (yh > MAXY) yh = MAXY; /* MAXY OK; loop check below is <, not <= */
  277.   
  278.       /* check all spots in the range.  find the one that is closest to
  279.          the player.  if the monster is already next to the player, exit
  280. *** scores.org  Sun Mar 03 23:59:52 1991
  281. --- scores.c    Mon May 13 20:32:30 1991
  282. ***************
  283. *** 72,78 ****
  284. --- 72,80 ----
  285.       long moves;         /* number of moves made by player                   */
  286.       short ac;           /* armor class of player                            */
  287.       short hp,hpmax;     /* players hitpoints                                */
  288. + # ifndef MSDOS
  289.       short cputime;      /* cpu time needed in seconds                       */
  290. + # endif
  291.       short killed,spused;/* monsters killed and spells cast                  */
  292.       short usage;        /* usage of the cpu in %                            */
  293.       short lev;          /* player level                                     */
  294. ***************
  295. *** 511,519 ****
  296. --- 513,523 ----
  297.       register int f,win;
  298.       char ch,*mod;
  299.       long zzz,i;
  300. + #ifndef MSDOS
  301.   # ifdef EXTRA
  302.       struct tms cputime;
  303.   # endif
  304. + #endif
  305.       if (c[LIFEPROT]>0) /* if life protection */
  306.           {
  307.           switch((x>0) ? x : -x)
  308. ***************
  309. *** 572,579 ****
  310. --- 576,585 ----
  311.           time(&zzz);   /* get cpu time -- write out score info */
  312.           logg.diedtime=zzz;
  313.   #ifdef EXTRA
  314. + # ifndef MSDOS
  315.           times(&cputime);  /* get cpu time -- write out score info */
  316.           logg.cputime = i = (cputime.tms_utime + cputime.tms_stime)/60 + c[CPUTIME];
  317. + # endif
  318.           logg.lev=c[LEVEL];          logg.ac=c[AC];
  319.           logg.hpmax=c[HPMAX];        logg.hp=c[HP];
  320.           logg.elapsedtime=(zzz-initialtime+59)/60;
  321. ***************
  322. *** 645,653 ****
  323.   #ifdef EXTRA
  324.           if (logg.moves<=0) logg.moves=1;
  325.           lprintf("  Experience Level: %d,  AC: %d,  HP: %d/%d,  Elapsed Time: %d minutes\n",(long)(logg.lev),(long)(logg.ac),(long)(logg.hp),(long)(logg.hpmax),(long)(logg.elapsedtime));
  326.           lprintf("  CPU time used: %d seconds,  Machine usage: %d.%02d%%\n",(long)(logg.cputime),(long)(logg.usage/100),(long)(logg.usage%100));
  327.           lprintf("  BYTES in: %d, out: %d, moves: %d, deaths: %d, spells cast: %d\n",(long)(logg.bytin),(long)(logg.bytout),(long)(logg.moves),(long)(logg.killed),(long)(logg.spused));
  328. !         lprintf("  out bytes per move: %d,  time per move: %d ms\n",(long)(logg.bytout/logg.moves),(long)((logg.cputime*1000)/logg.moves));
  329.   #endif
  330.           }
  331.           lflush();  lrclose();  return;
  332. --- 651,665 ----
  333.   #ifdef EXTRA
  334.           if (logg.moves<=0) logg.moves=1;
  335.           lprintf("  Experience Level: %d,  AC: %d,  HP: %d/%d,  Elapsed Time: %d minutes\n",(long)(logg.lev),(long)(logg.ac),(long)(logg.hp),(long)(logg.hpmax),(long)(logg.elapsedtime));
  336. + # ifndef MSDOS
  337.           lprintf("  CPU time used: %d seconds,  Machine usage: %d.%02d%%\n",(long)(logg.cputime),(long)(logg.usage/100),(long)(logg.usage%100));
  338. + # endif
  339.           lprintf("  BYTES in: %d, out: %d, moves: %d, deaths: %d, spells cast: %d\n",(long)(logg.bytin),(long)(logg.bytout),(long)(logg.moves),(long)(logg.killed),(long)(logg.spused));
  340. !         lprintf("  out bytes per move: %d",(long)(logg.bytout/logg.moves));
  341. ! # ifndef MSDOS
  342. !         lprintf(",  time per move: %d ms",(long)((logg.cputime*1000)/logg.moves));
  343. ! # endif
  344. !         lprintf("\n");
  345.   #endif
  346.           }
  347.           lflush();  lrclose();  return;
  348.  
  349.